package br.com.adimoveis.main;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import br.com.adimoveis.ui.MainView;
import br.com.adimoveis.util.ui.Splash;


public class Main {

	public static void main(String[] args) {
		
		ApplicationContext factory = new ClassPathXmlApplicationContext(new String[] {"beans.xml"});
		MainView mainView = (MainView) factory.getBean("mainView");
		
		try {
			Splash splash = new Splash("eCorretor Splash azul.png");
			 splash.open(3000);
			 Thread.sleep(3000);
		} catch (Exception e1) {
			JOptionPane.showMessageDialog(new JFrame(), e1.getMessage(),"Erro", JOptionPane.ERROR_MESSAGE);
		}
		
		try{
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}catch(Exception e){
			e.printStackTrace();
		}

		mainView.show();
		
	}
}
